﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace SH.Room.ErrorCodeEnum
{
    public class AppService
    {
        public static IServiceCollection Services { get; set; }

        public static IConfiguration Configuration { get; set; }

        public static HttpContext CurrentHttpContext
        {
            get
            {
                var factory = Services.BuildServiceProvider().GetService(typeof(IHttpContextAccessor));
                HttpContext context = ((IHttpContextAccessor)factory).HttpContext;
                return context;
            }
        }

    }
}
